<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page session="true"%>
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<portlet:defineObjects />

<html>

<script>
	function getForm(namespace, name) {
        return document.forms[namespace + name];
    }

    function submitForm(namespace, name, action, page) {
        var frm = getForm(namespace, name);
        frm.txtAction.value = action;
        frm.submitLink.value = page;
        frm.submit();
    }
</script>

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Personal Information Tracking System</title>
<meta name="keywords" content="" />
<meta name="description" content="" />

<script type="text/javascript"
	src='<%=renderRequest.getContextPath() + "simpletreemenu.js" %>'>
/***********************************************
* Simple Tree Menu- Â© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<link rel="stylesheet" type="text/css" href="style/simpletree.css" />

<script type="text/javascript"
	src='<%=renderRequest.getContextPath() + "/js/calendarDateInput.js" %>'>

/***********************************************
* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
* Script featured on and available at http://www.dynamicdrive.com
* Keep this notice intact for use.
***********************************************/

</script>

<link href="style/style.css" rel="stylesheet" type="text/css"
	media="screen" />
</head>

<body>
<form name="<portlet:namespace/>myForm" action="<portlet:actionURL/>"
	method="POST"><input type="hidden" name="txtAction" /> <input
	type="hidden" name="submitLink" />
<p align="right">You are logging in as <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'editEmployeeInfo')"><b>${sessionScope.userName}</b></a>
! &nbsp; <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'home')">Home</a>
| &nbsp; <a href="#"
	onclick="submitForm('<portlet:namespace/>', 'myForm', 'logout')">Logout</a>
</p>
</form>

<form name="<portlet:namespace/>editTakenCompanyInfoForm"
	action="<portlet:actionURL/>" method="POST"><input type="hidden"
	name="txtAction" /> <input type="hidden" name="submitLink" />
<table align="center">
	<tr class="title">
		<td colspan="2">
		<h1><a href="#">Personal information tracking system </a></h1>
		<p>exploit the value of data</p>
		<hr />
		</td>
	</tr>

	<tr>
		<td>
		<table border="1">
			<tr>
				<td>
				<h4 align="center" style="color: #FF0000">${sessionScope.successMess}
				${sessionScope.errorMess}</h4>
				</td>
			</tr>
			<tr>
				<td>
				<h2 class="title">Experience Information</h2>
				</td>
			</tr>
			<tr>
				<td><em>General Information </em></td>
			</tr>
			<tr>
				<td>
				<table border="1" width="100%">
					<tr>
						<td align="left" valign="bottom">&nbsp;Company</td>
						<td align="left" valign="middle" colspan="2">
						${sessionScope.departExp.department.company.comName}</td>
					</tr>
					<tr>
						<td align="left" valign="bottom">&nbsp;Address&nbsp;</td>
						<td align="left" valign="middle" colspan="2">
						${sessionScope.departExp.department.company.address}</td>
					</tr>
					<tr>
						<td align="left" valign="bottom">&nbsp;Phone&nbsp;</td>
						<td align="left" valign="bottom" colspan="2">
						${sessionScope.departExp.department.company.phone}</td>
					</tr>
					<tr>
						<td>&nbsp;Department&nbsp;</td>
						<td colspan="2" align="left" valign="middle"><input
							type="hidden" name="preDepartID" id="pre" /> <select
							name="txtDepartID"
							onchange="if(this.value=='Other'){
														this.form.otherDepart.style.visibility='visible';
														this.form.otherDepart.focus();}
												else{this.form.otherDepart.style.visibility='hidden';}">
							<c:forEach items="${sessionScope.company.departments}" var="list">
								<option id="depart${list.departID}" value="${list.departID}">${list.departName}</option>
							</c:forEach>
							<option value="Other">Other</option>
						</select> <script type="text/javascript">
										document.getElementById("depart${sessionScope.departExp.department.departID}").setAttribute("selected", "true");
										document.getElementById("pre").setAttribute("value", "${sessionScope.departExp.department.departID}");
									</script> <input name="otherDepart" type="text"
							style="visibility: hidden" /></td>
					</tr>
					<tr>
						<td align="left" valign="middle" rowspan="2">&nbsp;Working
						Period&nbsp;</td>
						<td align="left" valign="middle">From</td>
						<td align="center" valign="middle">&nbsp; <script>
										DateInput('txtStartDate', true, 'DD/MM/YYYY', '<%= request.getContextPath() %>', '${sessionScope.departExp.startDate}');
									</script></td>
					</tr>
					<tr>
						<td align="left" valign="middle">&nbsp;To&nbsp;</td>
						<td align="center" valign="bottom">&nbsp; <script>
										DateInput('txtEndDate', true, 'DD/MM/YYYY', '<%= request.getContextPath() %>', '${sessionScope.departExp.endDate}');
									</script></td>
					</tr>
					<tr>
						<td align="left" valign="middle">&nbsp;Role&nbsp;</td>
						<td><textarea name="txtRole" id="txtRole" rows="1"></textarea></td>
						<td align="left" valign="top"><select name="selectRole"
							onchange="if(this.value=='Other'){
														this.form.otherRole.style.visibility='visible';
														this.form.otherRole.focus();}
												else{this.form.otherRole.style.visibility='hidden';}">
							<c:forEach items="${sessionScope.roles}" var="role">
								<option id="role${role.roleID}" value="${role.role}">${role.role}</option>
							</c:forEach>
							<option value="Other">Other</option>
						</select> <script type="text/javascript">
                                    	document.getElementById("role${sessionScope.departExp.role.roleID}").setAttribute("selected", "true");
                                    	document.getElementById("txtRole").setAttribute("value", "${sessionScope.departExp.role.role}");
                                    </script> <input name="otherRole" type="text"
							style="visibility: hidden" /> <input type="button" value="Add"
							onclick="
									  				if (this.form.txtRole.value=='') {
										  				if (this.form.selectRole.value!='Other') {
											  				this.form.txtRole.value = this.form.selectRole.value;
										  				} else {
											  				this.form.txtRole.value = this.form.otherRole.value;
										  				}
									  				}
													/*if(this.form.txtRole.value!='Other'){
														if(this.form.projectRole.value==''){
															this.form.projectRole.value = this.form.txtRole.value;
														} else{
															if (this.form.projectRole.value.search(this.form.txtRole.value) == -1)
															{
																this.form.projectRole.value = this.form.projectRole.value+', '+this.form.txtRole.value;
																}
														}
													}else{
														if(this.form.projectRole.value==''){
															this.form.projectRole.value = this.form.otherRole.value;
														} else{
															if (this.form.projectRole.value.search(this.form.otherRole.value) == -1)
															{
																this.form.projectRole.value = this.form.projectRole.value+', '+this.form.otherRole.value;
															}
														}
													}*/
													" />
						&nbsp;<input type="button" value="Clear"
							onclick="
													this.form.txtRole.value='';
									" />
						</td>

					</tr>
					<tr>
						<td>More Description</td>
						<td align="left" valign="top" colspan="2"><textarea
							name="txtDescription" rows="2">${sessionScope.departExp.description}</textarea>
						</td>
					</tr>

					<tr align="left" valign="bottom">
						<td colspan="3"><input type="button" value="Update"
							onclick="submitForm('<portlet:namespace/>', 'editTakenCompanyInfoForm',
						  	  					'confirm', 'EditTakenCompanyInfo.jsp')" />
						<input type="button" value="Cancel"
							onclick="submitForm('<portlet:namespace/>', 'editTakenCompanyInfoForm',
						  	  					'cancel', 'EditTakenCompanyInfo.jsp')" />
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<div style="clear: both;">&nbsp;</div>
		<div id="footer">
		<p>Development by HCMUT Project 1 Group 4 Spring 2010</p>
		</div>
		</td>
	</tr>
</table>
</form>
</body>

</html>